home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 March / macformat-035.iso / Shareware City / Developers / FFTs for RISC 1.0 / ffttest.m < prev    next >
Encoding:
Text File  |  1995-12-19  |  304 b   |  18 lines  |  [TEXT/MATL]

  1. N=64;
  2. j=sqrt(-1);
  3. a=ones(N,1);
  4. row=0;
  5. for i1=1:N;
  6.     a(i1) = sqrt(row+i1-1+.77777)+j*((row+i1-1+.22222)*(row+i1-1+.22222) / N - N/2);
  7. end;
  8. a(1) = N+3+j*imag(a(1));
  9. a(2) = 1-N+j*imag(a(2));
  10. A=fft(a);
  11. a1=ifft(A);
  12. if N<=32
  13.     A
  14.     a1
  15. end
  16. max(abs(A-atrans)./(max(abs(A))/N))
  17. max(abs(a1-aitrans)./(max(abs(a1))/N))
  18.